// 器材入库
import request from "@/api/request";
// import { pa } from "element-plus/es/locale";

// 分页查询入库单
export const search_rk = (params) => {
  return request({
    url: "/equipmentmanage/es/selectAll",
    method: "post",
    data: params,
  });
};

//   逻辑删除器材入库单
export const del_rk = (params) => {
  return request({
    url: "/equipmentmanage/es/delete/" + params,
    method: "post",
  });
};

// 用户列表
export const person_rk = (params) => {
  return request({
    url: "/equipmentmanage/esd/userList/"+params,
    method: "post",
  });
};

//   仓库列表
export const warehouse_rk = () => {
  return request({
    url: "/equipmentmanage/esd/depotList",
    method: "post",
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

// 装备分类树
export const tree_rk = (params) => {
  return request({
    url: "/equipmentmanage/esd/equipTree/" + params,
    method: "post",
    // headers: { "Content-Type":"application/json;charset=UTF-8" },
  });
};

// 装备列表
// export const equip_rk = (params) => {
//   return request({
//     url: "/equipmentmanage/esd/equipmentList",
//     method: "post",
//     data:params,
//   });
// };
export const equip_list = (params) => {
  return request({
    url: "/equipmentmanage/esd/equipmentList",
    method: "post",
    data: params,
  });
};

// 新增器材入库单
export const add_rk = (params) => {
  return request({
    url: "/equipmentmanage/es/insert",
    method: "post",
    data: params,
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

// 查询器材入库单详情
export const details_rk = (params) => {
  return request({
    url: "/equipmentmanage/es/selectDetails/" + params,
    method: "post",
  });
};

// 修改器材入库单
export const update_rk = (params) => {
  return request({
    url: "/equipmentmanage/es/update",
    method: "post",
    data: params,
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

// 组织机构列表
export const zz_rk = () => {
  return request({
    url: "/equipmentmanage/esd/orgList",
    method: "post",
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

// 储位列表
export const cw_rk = () => {
  return request({
    url: "/equipmentmanage/esd/proOrgList",
    method: "post",
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

// 器材入库单提交
export const submit_rk = (params) => {
  return request({
    url: "/equipmentmanage/es/commit",
    method: "post",
    data: params,
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

// 获取单据审核历史
export const history_rk = (params) => {
  return request({
    url: "/equipmentmanage/es/getAuditHistory",
    method: "post",
    data: params,
    // headers: { "Content-Type":"application/json;charset=UTF-8" },
  });
};

// 器材入库单审核
export const audit_rk = (params) => {
  return request({
    url: "/equipmentmanage/es/audit",
    method: "post",
    data: params,
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

// 单据作废
export const cancel_rk = (params) => {
  return request({
    url: "/equipmentmanage/es/cancel",
    method: "post",
    data: params,
    // headers: { "Content-Type":"application/json;charset=UTF-8" },
  });
};

// 器材入库单回退
export const undo_rk = (params) => {
  return request({
    url: "/equipmentmanage/es/undo",
    method: "post",
    data: params,
    // headers: { "Content-Type":"application/json;charset=UTF-8" },
  });
};

// 删除子表
export const deleteson_rk = (params) => {
  return request({
    url: "/equipmentmanage/esd/delete/" + params,
    method: "post",
  });
};

// 子表设置冻结状态
export const set_freeze = (params) => {
  return request({
    url: "/essentialdata/op/setFreeze/" + params,
    method: "post",
  });
};


// 单别
export const ordCategoryList_equip = (params) => {
  return request({
    url: "/equipmentmanage/es/ordCategoryList/" + params,
    method: "post",
  });
};